using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using Microsoft.Xna.Framework;
using HappySprite;
using HappySprite.Graphics;
using HappySprite.SceneGraph;

namespace HappyInvaders
{
    abstract class Visual
    {
        SceneItem<Quad> item = new SceneItem<Quad>();

        public Visual()
        {
        }

        internal SceneItem<Quad> Item
        {
            get { return item; }
        }

        public virtual void SetPosition(Vector2 position)
        {
            item.World.Position = new Vector3(position, 0f);
        }

        public virtual void SetTexture(BitArray bitArray)
        {
        }

        public void Remove()
        {
            OnRemove();
            item.Parent.Remove(item);
            Global.RecycleBin.Recycle(this);
        }

        internal virtual void OnAdd(View view)
        {
        }

        internal virtual void OnRemove()
        {
        }
    }
}
